package com.chhlz.module.base.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.chhlz.module.base.model.DiningTable;
import com.chhlz.module.service.TableService;
import com.opensymphony.xwork2.ModelDriven;

@Controller
@Action(value = "table", results = { @Result(name = "table", location = "/table.html") })
public class TableAction extends BasicDataAction<DiningTable>
implements ModelDriven<DiningTable>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 6675947172471950785L;
	
	@Autowired
	private TableService tableService;
	
	private DiningTable table = new DiningTable();

	@Override
	public DiningTable getModel() {
		return table;
	}
	
	public void grid(){
		super.grid(tableService);
	}
	
	public void add(){
		super.add(tableService, table);
	}
	
	public void edit(){
		super.edit(tableService, table);
	}
	
	public void remove(){
		super.remove(tableService, table.getId());
	}

}
